package o;

import com.google.android.exoplayer2.C;

public final class anm implements ana {
    private boolean ˊ;
    private abq ˋ = abq.ˎ;
    private long ˎ;
    private final ams ˏ;
    private long ॱ;

    public anm(ams o_ams) {
        this.ˏ = o_ams;
    }

    public void ˎ() {
        if (!this.ˊ) {
            this.ॱ = this.ˏ.ˏ();
            this.ˊ = true;
        }
    }

    public void ˊ() {
        if (this.ˊ) {
            ˊ(ॱ());
            this.ˊ = false;
        }
    }

    public void ˊ(long j) {
        this.ˎ = j;
        if (this.ˊ) {
            this.ॱ = this.ˏ.ˏ();
        }
    }

    public long ॱ() {
        long j = this.ˎ;
        if (!this.ˊ) {
            return j;
        }
        long ˏ = this.ˏ.ˏ() - this.ॱ;
        if (this.ˋ.ॱ == 1.0f) {
            return j + C.ˏ(ˏ);
        }
        return j + this.ˋ.ॱ(ˏ);
    }

    public abq ॱ(abq o_abq) {
        if (this.ˊ) {
            ˊ(ॱ());
        }
        this.ˋ = o_abq;
        return o_abq;
    }

    public abq e_() {
        return this.ˋ;
    }
}
